#include <fhe/prims/Material.h>
#include <fhe/core/Registerers.h>

namespace fhe
{
  namespace core
  {
    Material::Material()
    {
    }
    
    void Material::serialize( const Data::Ptr& data, Material material )
    {
      FileSystem::instance().serialize( data->addChild( "color" ), material.color );
    }
    
    Material Material::deserialize( const Data::Ptr& data )
    {
      Material material;
      if ( data->hasChild( "color" ) )
      {
        material.color = FileSystem::instance().deserialize<Color>( data->getChild( "color" ) );
      }
      return material;
    }
    
    FHE_SERIALIZER_TYPE( Material );
  }
}
